cg_LLVM: Stop needing an alloca for volatile loads#157127
Merged
rust-bors[bot] merged 1 commit intoJun 27, 2026
Merged
Conversation
bjorn3
reviewed
May 30, 2026
RalfJung
reviewed
May 31, 2026
ff8746f to
9ff8e99
Compare
Collaborator
|
The GCC codegen subtree was changed |
This comment has been minimized.
This comment has been minimized.
scottmcm
commented
Jun 3, 2026
This comment has been minimized.
This comment has been minimized.
9ff8e99 to
d82afbd
Compare
This comment has been minimized.
This comment has been minimized.
d82afbd to
b5c38a6
Compare
This comment has been minimized.
This comment has been minimized.
b5c38a6 to
d844e5f
Compare
scottmcm
commented
Jun 6, 2026
|
|
||
| fn volatile_load(&mut self, ty: Type<'gcc>, ptr: RValue<'gcc>) -> RValue<'gcc> { | ||
| fn volatile_load(&mut self, ty: Type<'gcc>, ptr: RValue<'gcc>, _: Align) -> RValue<'gcc> { | ||
| // FIXME(antoyo): set alignment. |
Member
Author
There was a problem hiding this comment.
annot: it wasn't obvious to me how to get this to work -- maybe that's why it was already a FIXME -- so I ended up just moving the FIXME from the volatile_load intrinsic to the volatile_load builder method, which doesn't make anything worse at least.
This comment has been minimized.
This comment has been minimized.
d844e5f to
9032be2
Compare
Member
Author
|
Sorry for taking a bazillion iterations on this. CI is happy now, so I think this is finally |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 4 pull requests Successful merges: - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 4 pull requests Successful merges: - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 26, 2026
…ve, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue rust-lang#153250
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 26, 2026
…ve, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue rust-lang#153250
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 7 pull requests Successful merges: - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158430 (Guard clone suggestion against empty obligation errors)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 26, 2026
…ve, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue rust-lang#153250
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 11 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 15 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #158438 (Use rigidness marker in fast_reject) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158382 (Add safety section for SliceIndex::get_unchecked(mut)) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158446 (Update Enzyme submodule) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 26, 2026
…uwer Rollup of 15 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #158438 (Use rigidness marker in fast_reject) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158382 (Add safety section for SliceIndex::get_unchecked(mut)) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158446 (Update Enzyme submodule) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 15 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - #158438 (Use rigidness marker in fast_reject) - #157127 (cg_LLVM: Stop needing an alloca for volatile loads) - #158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - #158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - #158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - #158355 (Fixup the refactoring errors in #156246) - #158361 (Move `check_ffi_pure` into the attribute parser) - #158382 (Add safety section for SliceIndex::get_unchecked(mut)) - #158399 (std: truncate thread names on NetBSD) - #158418 (Eliminate double length check in `Vec::into_array`) - #158430 (Guard clone suggestion against empty obligation errors) - #158446 (Update Enzyme submodule) - #158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
rust-timer
added a commit
that referenced
this pull request
Jun 27, 2026
Rollup merge of #157127 - scottmcm:tweak-layout-of-alternative, r=nikic cg_LLVM: Stop needing an alloca for volatile loads This ended up also being reimplementing it to not use `load` of the `llvm_type`, since without doing that everything blew up horribly. cc the zulip conversation [#t-opsem > Defining volatile splitting @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Defining.20volatile.20splitting/near/597451615). And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since `unaligned_volatile_load::<u8>` doesn't actually test anything. r? @nikic cc @RalfJung MCP tracking issue #153250
pull Bot
pushed a commit
to LeeeeeeM/miri
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 15 pull requests Successful merges: - rust-lang/rust#153697 (Add arg splat experiment initial tuple impl) - rust-lang/rust#158360 (Various borrowck cleanups and param_env/opaque_types_defined_by query simplifications for typeck children) - rust-lang/rust#158438 (Use rigidness marker in fast_reject) - rust-lang/rust#157127 (cg_LLVM: Stop needing an alloca for volatile loads) - rust-lang/rust#158376 (Suggest `>=` for `=>` typo in closure and call argument positions) - rust-lang/rust#158185 (perf: Make stable_crate_ids reads lock-free after crate loading) - rust-lang/rust#158244 (Attribute docs `deprecated` , `warn`, `allow`, `cfg`, `deny`, and `forbid` ) - rust-lang/rust#158355 (Fixup the refactoring errors in rust-lang/rust#156246) - rust-lang/rust#158361 (Move `check_ffi_pure` into the attribute parser) - rust-lang/rust#158382 (Add safety section for SliceIndex::get_unchecked(mut)) - rust-lang/rust#158399 (std: truncate thread names on NetBSD) - rust-lang/rust#158418 (Eliminate double length check in `Vec::into_array`) - rust-lang/rust#158430 (Guard clone suggestion against empty obligation errors) - rust-lang/rust#158446 (Update Enzyme submodule) - rust-lang/rust#158448 (Cleanup `NumBuffer` comment and replace `ilog(10)` with `ilog10()`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This ended up also being reimplementing it to not use
loadof thellvm_type, since without doing that everything blew up horribly. cc the zulip conversation #t-opsem > Defining volatile splitting @ 💬.And while I'm here, improve the tests to check that the unaligned ones are actually unaligned, since
unaligned_volatile_load::<u8>doesn't actually test anything.r? @nikic
cc @RalfJung
MCP tracking issue #153250